﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SocialCee.Authorization.Tests
{
    [TestClass]
    public class RoleManager
    {
        [TestMethod]
        public void CreateBaseRoles()
        {
            bool created = SocialCee.Authorization.RoleManager.CreateRole(SocialCee.Authorization.Enums.ERoles.system_administrator.ToString());
            Assert.IsTrue(created);

            created = SocialCee.Authorization.RoleManager.CreateRole(SocialCee.Authorization.Enums.ERoles.end_user.ToString());
            Assert.IsTrue(created);
        }

        [TestMethod]
        public void AssignUserToBaseRoles()
        {
            bool created = SocialCee.Authorization.RoleManager.AssignUserToRole("test2", SocialCee.Authorization.Enums.ERoles.system_administrator.ToString());
            Assert.IsTrue(created);

            created = SocialCee.Authorization.RoleManager.AssignUserToRole("test2", SocialCee.Authorization.Enums.ERoles.end_user.ToString());
            Assert.IsTrue(created);
        }

        [TestMethod]
        public void CreateRole()
        {
            bool created = SocialCee.Authorization.RoleManager.CreateRole("test_role");

            Assert.IsTrue(created);
        }
    }
}
